const { Sequelize, sequelize } = require('./sequelize');

// // 测试连接
// sequelize.authenticate().then(() => {
//   console.log('Connection has been established successfully.');
// }).catch(err => {
//   console.error('Unable to connect to the database:', error);
// })

const TheClass = sequelize.define('TheClass', {
  tcId: {
    type: Sequelize.INTEGER,
    allowNull: false,
    primaryKey: true,
    unique: true,
  },
  tcName: {
    type: Sequelize.STRING,
    allowNull: false,
  },
  tcNumber: {
    type: Sequelize.INTEGER,
    allowNull: false,
  }
}, {
  modelName: 'TheClass',
  tableName: 'the_class',
  timestamps: false,
});

module.exports = {
  TheClass
};
